#include "cconsumenutrition.h"
#include "cconstdefinition.h"

CConsumeNutrition::CConsumeNutrition(QObject *parent) :
    CObject(parent)
{
//    m_id = KInvalidId;
    m_consume_id = KInvalidId;
    m_nutrition_id = KInvalidId;
    m_quantity = 0.0;
    m_unit_type_id = KInvalidId;
}

//int CConsumeNutrition::id() {
//    return m_id;
//}

//void CConsumeNutrition::setId(int id) {
//    if (m_id != id) {
//        m_id = id;
//        emit idChanged();
//    }
//}

int CConsumeNutrition::consumeId() {
    return m_consume_id;
}

void CConsumeNutrition::setConsumeId(int consumeId) {
    if (m_consume_id != consumeId) {
        m_consume_id = consumeId;
        emit consumeIdChanged();
    }
}

int CConsumeNutrition::nutritionId() {
    return m_nutrition_id;
}

void CConsumeNutrition::setNutritionId(int nutritionId) {
    if (m_nutrition_id != nutritionId) {
        m_nutrition_id = nutritionId;
        emit nutritionIdChanged();
    }
}

double CConsumeNutrition::quantity() {
    return m_quantity;
}

void CConsumeNutrition::setQuantity(double quantity) {
    if (m_quantity != quantity) {
        m_quantity = quantity;
        emit quantityChanged();
    }
}

int CConsumeNutrition::unitTypeId() {
    return m_unit_type_id;
}

void CConsumeNutrition::setUnitTypeId(int unitTypeId) {
    if (m_unit_type_id != unitTypeId) {
        m_unit_type_id = unitTypeId;
        emit unitTypeIdChanged();
    }
}
